import 'package:flutter_plugin/base/controller/base_controller.dart';
import 'package:flutter_plugin/util/log_util.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:get/get.dart';
import 'webview_state.dart';

class WebviewLogic extends BaseController {
  final WebviewState state = WebviewState();

  @override
  void loadNet() {
    // TODO: implement loadNet
  }

  String? title;

  WebViewController? controller;

  @override
  void onInit() {
    super.onInit();
    title = Get.arguments["title"];
    String url = Get.arguments["url"];

    LogD("WebviewLogic $title $url");

    controller = WebViewController()
      ..setJavaScriptMode(JavaScriptMode.unrestricted)
      ..loadRequest(Uri.parse(url));
  }
}
